package org.example.visitor;

import java.util.ArrayList;
import java.util.List;

public class TableInfo {
    private String tableName;
    private List<String> columnNames = new ArrayList<>();
    private List<Index> indexes = new ArrayList<>();
    private List<String> partitions = new ArrayList<>();

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public List<String> getColumnNames() {
        return columnNames;
    }

    public void setColumnNames(List<String> columnNames) {
        this.columnNames = columnNames;
    }

    public List<Index> getIndexes() {
        return indexes;
    }

    public void setIndexes(List<Index> indexes) {
        this.indexes = indexes;
    }

    public List<String> getPartitions() {
        return partitions;
    }

    public void setPartitions(List<String> partitions) {
        this.partitions = partitions;
    }

    public static class Index {
        private String indexName;
        private List<String> indexColumnNames = new ArrayList<>();

        public String getIndexName() {
            return indexName;
        }

        public void setIndexName(String indexName) {
            this.indexName = indexName;
        }

        public List<String> getIndexColumnNames() {
            return indexColumnNames;
        }

        public void setIndexColumnNames(List<String> indexColumnNames) {
            this.indexColumnNames = indexColumnNames;
        }

        @Override
        public String toString() {
            return "\nIndex{\n" +
                    "indexName=" + indexName +
                    ",\nindexColumnNames=" + indexColumnNames +
                    "\n}";
        }
    }

    @Override
    public String toString() {
        return "TableInfo{\n" +
                "tableName=" + tableName +
                ",\ncolumnNames=" + columnNames +
                ",\nindexes=" + indexes +
                ",\npartitions=" + partitions +
                "\n}";
    }
}
